<?php
require_once "managerSession.php";
$Item="黑名单管理";
if(isset($_REQUEST["page"])){
    $page=$_REQUEST["page"];
}else{
    $page=1;
}
if(isset($_REQUEST["open"])){
    $core->OpenUser($_REQUEST["open"]);
}

$search="";
$pageCount=0;
$arr=[];
if (isset($_REQUEST["search"])&&!empty($search=trim($_REQUEST["search"]))){
    $pageCount=ceil($core->GetNonUseUserBySearchCount($search)/20);
    $arr=$core->GetNonUseUserBySearch($search,$page);
}else{
    $pageCount=ceil($core->GetNonUseUsersCount()/20);
    $arr=$core->GetNonUseUsers($page);
}

?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>娱乐会所吧台管理系统</title>
    <?php include_once "link.php"; ?>
</head>
<body class="container">
<?php require_once "Nav.php"; ?>
<div class="main">
    <?php include_once "menu.php"; ?>
    <div class="pr inlb bd col-xs-10">
        <table class="table table-striped">
            <caption>
                黑名单管理
                <form id="search" class="pull-right" action="">
                    <input type="text" name="search" value="<?php echo $search; ?>">
                    <button>搜索</button>
                </form>
            </caption>
            <tr>
                <th>姓名</th>
                <th>微信</th>
                <th>手机</th>
                <th>总消费</th>
                <th>总佣金</th>
                <th>操作</th>
            </tr>
            <?php

            for($i=0;$i<count($arr);++$i){
            ?>
            <tr>
                <td><?php echo $arr[$i]["name"]; ?></td>
                <td><?php echo $arr[$i]["weixin_Id"]; ?></td>
                <td><?php echo $arr[$i]["phone"]; ?></td>
                <td><?php echo $arr[$i]["expend"]; ?></td>
                <td><?php echo $arr[$i]["bonus"]; ?></td>
                <td><a class="btn btn-primary" href="?open=<?php echo $arr[$i]["id"]."&page=$page&search=$search"; ?>">启用该用户</a></td>
            </tr>
            <?php } ?>
        </table>
        <div class="pager">
            <?php
            pageList($pageCount, $page, "&search=$search");
            ?>
        </div>
    </div>
</div>
</body>
</html>
